package huanzhao.erp.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;


@TableName(value ="phone_publish_sold")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PhonePublishSold implements Serializable {
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 上架/售出时间
     */
    @TableField(value = "time")
    private Date time;

    /**
     * 手机id
     */
    @TableField(value = "phone_id")
    private Long phoneId;

    /**
     * 是否为上架
     */
    @TableField(value = "publish")
    private Boolean publish;

    /**
     * 金额：上架金额或售出金额
     */
    @TableField(value = "price")
    private BigDecimal price;

    /**
     * 上架/售出渠道id
     */
    @TableField(value = "team_id")
    private Long teamId;

    /**
     * 成色，范围0(全损)~100(全新)，上架时生效
     */
    @TableField(value = "degree")
    private Integer degree;

    @Serial
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    public PhonePublishSold(Long phoneId, Boolean publish, BigDecimal price, Long teamId, Integer degree) {
        this.phoneId = phoneId;
        this.publish = publish;
        this.price = price;
        this.teamId = teamId;
        this.degree = degree;
    }
}